clear all; close all; clc;
R=47;
L=100e-6;
tau=L/R;
fprintf('tau = %f usec\n', tau*1e6);
T=tau/100000;
t=0:T:(5*tau);
lt=length(t);
Ur=nan(1,lt);
f=0:1e4:1e6;
Ur(1)=0;
K=nan(0,length(f));
for k=1:length(f)
    E = cos(2*pi*f(k)*t);
for i=2:lt
    Ur(i)=Ur(i-1)+(E(i-1)-Ur(i-1))*T*R/L;
end
K(k)=max(Ur);
end
figure(1);
plot(f*1e5,K);
xlabel('f,MHz');
ylabel('K');
legend('K(t)');
grid on

 
